/*#################################################

Loader | v1.0 
Max Felker | max@bigroomstudios.com

Modal window overlay

#################################################*/
 
// START Class
var Loader = Class.create({

	initialize: function() {},
	
	display: function(config) {
	
		// if no config, create object
		if(!config) {
			config = {};
		}
		
		// config override
		config.container = "modal-loader";
		config.minimize = false;
		config.drag = false;
		config.title_height = '0';

		// set loading content with title if set
		config.content = "<div id='loading-title'>"+ ( config.title ? config.title : '' ) +"</div>";
		
		// open canopy, eliminate close
		live.canopy.display();
		live.canopy.btn_close.hide();
		
		// create popup
		this.popup = new Popup(config);
		this.popup.controls_container.hide();
		
		live.keys.stop_looking_for('esc');
		
		if(config.img) {
			this.popup.content.setStyle("background-image:url("+config.img+")");
		}
	},

	close: function() {
	
		if(this.popup) {
			this.popup.close();
		}
		
		live.canopy.close();

	}

}); // END Class 
